package com.zzyl.nursing.service.impl;

import cn.hutool.core.date.DateTime;
import com.zzyl.common.utils.bean.BeanUtils;
import com.zzyl.nursing.dto.ReservationDto;
import com.zzyl.nursing.mapper.ReservationMemberMapper;
import com.zzyl.nursing.service.ReservationMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class ReservationMemberServiceImpl implements ReservationMemberService {

    @Autowired
    private ReservationMemberMapper reservationMemberMapper;

    /**
     * 新增预约
     * @param reservationDto
     */
    @Override
    public void addReservation(ReservationDto reservationDto) {
//        ReservationDto reservation = new ReservationDto();
        reservationDto.setStatus(1);
        reservationDto.setCreateTime(DateTime.now());
//        BeanUtils.copyProperties(reservationDto,reservation);
        reservationMemberMapper.insertReservation(reservationDto);
    }
}
